﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<table align="center" id="frmTestForm">
    <thead>
        <tr>
            <th colspan="2">
                To Test Dirty Page Provide Input and Try to Naviagate from Upper Links.
            </th>
        </tr>
        <tr>
            <th colspan="2">
                &nbsp;
            </th>
        </tr>
        <tr>
            <th>
                Your Name
            </th>
            <th>
                Contact Number
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <input type="text" />
            </td>
            <td>
                <input type="text" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="button" value="Submit" />
                <input type="button" value="Clear Flag" onclick="DiscardChanges();" />
                <input type="button" value="Is My Container Dirty" onclick="IsMyPageDirty();" />
            </td>
        </tr>
    </tbody>
</table>
<script type="text/javascript">

    $(function () {
        WatchMyContainer('frmTestForm');
    });


    function DiscardChanges() {
        CleanMyContainer('frmTestForm');
    }

    function IsMyPageDirty() {
        if (IsMyContainerDirty('frmTestForm')) {
            alert('Yes');
        }
        else {
            alert('No');
        }
    }


</script>
